{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The goal of this section is to be able to __deepcopy__ sexp objects"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-03T23:48:07.805065Z",
     "start_time": "2019-04-03T23:48:07.600135Z"
    }
   },
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "\n",
    "import os\n",
    "from pykicad import Module\n",
    "import pykicad\n",
    "import copy\n",
    "path  ='/Users/zfphil/sci/sciled/footprint_library/SciLed.pretty/TLC5955.kicad_mod'\n",
    "module = open(path, 'r', encoding='utf-8').read()\n",
    "\n",
    "q = Module.parse(module)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-03T23:48:28.844954Z",
     "start_time": "2019-04-03T23:48:28.820706Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 0]\n"
     ]
    }
   ],
   "source": [
    "footprint_library_location = '/Users/zfphil/sci/sciled/footprint_library/'\n",
    "os.environ['KISYSMOD'] = os.pathsep + footprint_library_location\n",
    "\n",
    "r1 = Module.from_library('SciLed', 'TLC5955')\n",
    "\n",
    "r2 = Module.from_library('SciLed', 'TLC5955')\n",
    "r1.at = (10,10)\n",
    "print(r2.at)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-04-03T23:45:56.765535Z",
     "start_time": "2019-04-03T23:45:56.742863Z"
    }
   },
   "outputs": [],
   "source": [
    "copy.deepcopy(r1)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
